package com.future.bantang.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.future.bantang.R;
import com.future.bantang.app.BanTangAPP;
import com.future.bantang.entity.GoodThingsProductEntity;

/**
 * Created by zzh on 2016/1/12.
 */
public class FraGoodthingsGridAdapter extends AbsBaseAdapter<GoodThingsProductEntity.DataEntity.ProductEntity> {


    public FraGoodthingsGridAdapter(Context context) {
        super(context, R.layout.fragment_goodthings_item);
    }

    @Override
    public void bindDatas(ViewHolder viewHolder, GoodThingsProductEntity.DataEntity.ProductEntity data) {

        //加载商品图片
        ImageView ico=((ImageView) viewHolder.getView(R.id.img_goodthings_item_ico));
        BanTangAPP.getApp().getImageLoader().displayImage(data.getPic(),ico);

        //加载商品标题
        ((TextView)viewHolder.getView(R.id.txt_goodthings_item_title)).setText(data.getTitle());

        //加载商品价格
        ((TextView)viewHolder.getView(R.id.txt_goodthings_item_price)).setText(data.getPrice());


    }

}
